The performance of a computer is greatly affected by the speed at which a branch instruction may be executed. As is known, computers execute multipath instruction sequences, with a path selected at a node represented by a branch instruction. Path selection is based upon execution of the branch instruction. Branch instruction execution requires the comparison of operands within the computer to determine whether a branch is taken or not. The sooner the outcome can be determined, the better the performance of the computer.
A key element in determining whether a branch is to be taken or not is the comparison of operands on which the branch condition is contingent. Although the comparison of operands is a key element in other instruction types, branching is an important aspect of computer operation.
Generally, a branch instruction operation is performed by the arithmetic/logic unit of a computer according to a known procedure. A branching instruction includes three fields. One field indicates a register, R3, which contains an increment. A second field indicates a register, R1, containing the current value of an index. A third field indicates a branch destination. The instruction is executed by algebraically combining the increment in R3 with the current value in R1, and comparing the incremented current value against a compare value. If the R3 field is even, an even-odd pair of registers (R3 and R3+1) is understood, containing the increment and compare values, respectively. If the R3 field is odd, R3 contains both the increment and the compare value. In one type of branching instruction, a branch to the branch destination is taken when the incremented current value is higher than the final value. In another, the branch occurs when the incremented current value is less than or equal to the compare value.
There are many branch instructions that operate using these basic procedures. However, the instructions may be classified into two broad categories. The first category of instructions includes those where the branch is taken when the incremented current value is greater than the compare value. The other category of instructions are where the branch is taken when the incremented current value is less than or equal to the compare value.
The traditional method of determining the outcome of the two categories of branch instructions is to perform the increment operation, subtract the compared value from the increment result, and determine if the result of the subtraction is greater than, less than, or equal to zero. Depending on this determination, the branch is either taken or not. Therefore, in the prior art, determining whether the branch will be taken must wait until the increment and compare operations are completed. In most machines, these operations require two machine cycles. It is an objective of the present invention to reduce the time required for the determination of a branch condition, or other condition depending upon a similar comparison of operands.